<!---If the current user is logged in then don't allow them to delete their own username/CustPassword--->
<cfquery name = "CheckUsers" datasource="#request.dsn#">
SELECT * FROM core_admins
WHERE id = <cfqueryparam value="#url.id#" cfsqltype="cf_sql_integer">
</cfquery>

<cfif request.admin_username IS CheckUsers.Username>
<center>You cannot delete a user that you are logged in under</center>
<cfabort>
</cfif>

<cfquery name = "DeleteUser" datasource="#request.dsn#">
DELETE FROM core_admins
WHERE id = <cfqueryparam value="#url.id#" cfsqltype="cf_sql_integer">
</cfquery>

<cflocation url = "index.cfm?c=cpusers">